package com.unitd.base.module.api.service;

import com.unitd.base.module.api.mybatis.mapper.ApiCommentMapper;
import com.unitd.base.module.api.entity.CommentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class ApiCommentService {
    @Autowired
    private ApiCommentMapper commentDao;

    public CommentVo queryObject(Integer id) {
        return commentDao.selectById(id);
    }

    public List<CommentVo> queryList(Map<String, Object> map) {
        return commentDao.selectByMap(map);
    }

    public int queryTotal(Map<String, Object> map) {
        return commentDao.queryTotal(map);
    }

    public int queryhasPicTotal(Map<String, Object> map) {
        return commentDao.queryhasPicTotal(map);
    }

    public int save(CommentVo comment) {
        return commentDao.insert(comment);
    }


    public void update(CommentVo comment) {
        commentDao.updateById(comment);
    }


    public void delete(Integer id) {
        commentDao.deleteById(id);
    }
}
